<?php
use yii\helpers\Url;
$this->title = $isComplete ? '会员资料' : '完善会员资料';

if (preg_match('/^(852|853)/', $userInfo['mobile'])) {
    $mobile = substr($userInfo['mobile'], 0, 3) . '-' . substr($userInfo['mobile'], 3);
} elseif (preg_match('/^86/', $userInfo['mobile'])) {
    $mobile = substr($userInfo['mobile'], 0, 2) . '-' . substr($userInfo['mobile'], 2);
} else {
    $mobile = $userInfo['mobile'];
}
?>

<?php if ($isComplete) { ?>
    <!-- <div class="weui_cells_title waringColor">·请填写您的真实信息，有机会获得会员赠礼！</div> -->
<?php } ?>
    <header class="info_header">
        <div class="logo-box">
           <img src="<?= Url::to('@web/jebsen/img/header.png')?>" alt="">          
        </div>
    </header>
    <!-- <form action="<?= Url::to(['member/profile']) ?>" method="get"> -->
       <!-- formDiv  start lisa-->
        <div class="form_box">
            <table class="view_profile" id="view_box" >
                <tbody>
                <tr class="list" >
                    <td class="icon_box"><img class="icon" src="<?= Url::to('@web/jebsen/img/i_user.png')?>" alt=""></td>
                    <td class="label_box"><label class="td_label">姓名<span class="require">*</span>:</label></td>
                    <td class="input_box">
                        <input id="nickName" readonly="readonly" class="td_input" type="text" value="<?= isset($userInfo['last_name']) ? $userInfo['last_name'] . ' ' . $userInfo['first_name'] : ''  ?>" style="border:none;" placeholder="请输入昵称">
                    </td>
                </tr>
                <tr class="list">
                    <td class="icon_box"><img class="icon" src="<?= Url::to('@web/jebsen/img/i_sex.png')?>" alt=""></td>
                    <td class="label_box"><label class="td_label">称谓<span class="require">*</span>:</label></td>
                    <td class="input_box">
                        <input id="gender" readonly="readonly" class="td_input" type="text" value="<?= $userInfo['gender'] ?>" style="border:none;" placeholder="请输入性别">
                    </td>
                </tr>
                <tr class="list">
                    <td class="icon_box"><img class="icon" src="<?= Url::to('@web/jebsen/img/i_tell.png')?>" alt=""></td>
                    <td class="label_box"><label class="td_label">电话<span class="require">*</span>:</label></td>
                    <td class="input_box">
                        <input id='iphone' readonly="readonly" class="td_input" name="mobile" type="text" value="<?= $mobile ?>" style="border:none;"  placeholder="请输入手机号码">
                    </td>
                </tr>
                <tr id="mail_list"><td colspan=3></td></tr>
                <tr class="list">
                    <td class="icon_box"><img class="icon" src="<?= Url::to('@web/jebsen/img/i_mail.png')?>" alt=""></td>
                    <td class="label_box"><label class="td_label">邮箱：</label></td>
                    <td class="input_box">
                        <input id="email" readonly="readonly" class="td_input" type="email" name="email" value="<?= isset($userInfo['email']) ? $userInfo['email'] : ""?>" style="border:none;" placeholder="">
                    </td>
                </tr>
                <tr class="list">
                    <td class="icon_box"><img class="icon" src="<?= Url::to('@web/jebsen/img/i_age.png')?>" alt=""></td>
                    <td class="label_box"><label class="td_label">年龄：</label></td>
                    <td class="input_box">
                        <input id="age" readonly="readonly" class="td_input" type="text" value="<?= isset($userInfo['agegroup']) ? $userInfo['agegroup'] : ""?>" style="border:none;" placeholder="">
                    </td>
                </tr>
                <tr class="list">
                    <td class="icon_box"><img class="icon" src="<?= Url::to('@web/jebsen/img/i_birth.png')?>" alt=""></td>
                    <td class="label_box"><label class="td_label">生日：</label></td>
                    <td class="input_box">
                        <input id="birthday" readonly="readonly" class="td_input" name="birthday" type="text" value="<?= ($userInfo['birth_yyyy'] != '1904') ? $userInfo['birth_mm'] . '月' . $userInfo['birth_dd'] . '日' : ''?>" style="border:none;" placeholder="">
                    </td>
                </tr>
                <tr class="list" >
                    <td class="icon_box"><img class="icon" src="<?= Url::to('@web/jebsen/img/i_add.png')?>" alt=""></td>
                    <td class="label_box"><label class="td_label">地区：</label></td>
                    <td class="input_box">
                        <input id="address" readonly="readonly" class="td_input" type="text" value="<?= $address ?>" style="border:none;text-overflow: ellipsis;" placeholder="">
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="" id="save">
                <input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">
                <input name="code" type="hidden" id="code" value="<?= isset($userInfo['code']) ? $userInfo['code'] : '' ?>">
                <!-- <input type="submit" class="weui_btn weui_btn_primary" href="Usermsg" value="修改"> -->
                <a type="submit" class="sub_btn" href="<?= Url::to(['member/profile']) ?>" style="background-color:#2bb2e1;">修&nbsp;改</a>
            </div>
        </div>
         <!-- formDiv  end   lisa-->
       
</div>
